package cn.rongdao.jrkabao.ui.cashadvance.uicomponent;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.R;
import cn.rongdao.jrkabao.bean.cashadvance.TransactionRecordBean;


/**
 * Created by jack on 2017/6/2
 */

public class ItemTransactionRecordUIComponent extends RelativeLayout {
    public ItemTransactionRecordUIComponent(Context context) {
        super(context);
    }

    public ItemTransactionRecordUIComponent(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ItemTransactionRecordUIComponent(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private TextView tvOrderNum;
    private TextView tvTitle;
    private TextView tvTime;
    private TextView tvMoney;
    private TextView tvBankCard;

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        tvOrderNum = findViewById(R.id.itr_tv_order_num);
        tvTitle = findViewById(R.id.itr_tv_title);
        tvTime = findViewById(R.id.itr_tv_time);
        tvMoney = findViewById(R.id.itr_tv_money);
        tvBankCard = findViewById(R.id.itr_tv_bank_card);
    }

    public void setContent(TransactionRecordBean.TradeBean data) {
        if (null != data) {
            setVisibility(VISIBLE);
            tvOrderNum.setText(FRString.valueOf(data.getOrder_no()));
            tvTitle.setText(FRString.valueOf(data.getDesc()));
            tvTime.setText(FRString.valueOf(data.getTrans_date()));
            tvMoney.setText(FRString.valueOf(data.getTrans_amount()));
            tvBankCard.setText(FRString.valueOf(data.getCard_info()));
        }
    }
}
